package academic.concordia.bankofquebec.entity;

import java.io.Serializable;
import java.util.Calendar;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Transient;

@Entity
@DiscriminatorValue(value="INVESTMENT_ACCOUNT")
public class GIC extends InvestmentAccount implements Serializable{

	private static final long serialVersionUID = 1L;
	
	public GIC() {
		super();
		this.attributes = AccountAttributes.GIC;
		this.type = this.attributes.name();
		this.setTimePeriod(Calendar.MONTH);
		this.setAnnualInterestRate(8);
		this.setStatus(BankAccountStatus.PENDING_INITIAL_INVESTMENT);
	}
	
	public double calculateInterests(){
		return super.calculateInterests() * this.getPeriodicity() / 12;
	}
	@Transient
	public boolean isTransferAccount(){
		return false;
	}

}
